/* 
 * File:   BlendingMethod.cpp
 * Author: RedEyedKiller
 * 
 * Created on 7 Οκτώβριος 2011, 1:13 πμ
 */

#include "BlendingMethod.h"

namespace gl
{

BlendingMethodName GetBlendingMethodName(const std::string& name)
{
    if(name == "Alpha") 
        return BLEND_ALPHA;
    else if(name == "Add") 
        return BLEND_ADD;
    else if(name == "Light") 
        return BLEND_LIGHT;
    else if(name == "Dark") 
        return BLEND_DARK;
    else if(name == "None") 
        return BLEND_NONE;
    else
        return BLEND_UNKNOWN;
}

void BlendingMethod::Set(GLenum sfactor, GLenum dfactor)
{
    this->sfactor = sfactor;
    this->dfactor = dfactor;
}

void BlendingMethod::Enable() const
{
    glBlendFunc( sfactor, dfactor );
}

}